.box{
    width: 100px;
    height: 100px;
    background-color: red;
    transform-origin: 50% 50%;
    /* transform: rotateZ(45deg); */
    animation: rotateZ 2s  linear infinite;
}

@keyframes rotateZ {
    from{
        transform:translateX(0px) rotate(0deg) ;
    }
    to{
        transform:translateX(300px) rotate(360deg) ;
    }
}
